<template>
  <div>
    <header>
      <van-icon name="arrow-left" @click="black" />
      <span class="address">新建地址</span>
      <span class="save">保存</span>
    </header>
    <ul>
      <li>
        <van-cell-group style="height:52px;padding-top:5px">
          <van-field class="input" v-model="value" placeholder="姓名" />
        </van-cell-group>
      </li>
      <li>
        <van-cell-group style="height:52px;padding-top:5px">
          <van-field v-model="value" placeholder="手机号码" />
        </van-cell-group>
      </li>
      <li>
        <div class="box">
          <van-icon name="location-o" class="i" />
          <van-cell-group style="height:52px;padding-top:5px">
            <van-field @click="changeshow" v-model="value" placeholder="点击选择地址" />
          </van-cell-group>
        </div>
        <van-popup v-model="show" position="bottom" :style="{ height: '40%' }">
          <van-area :area-list="areaList" value="110101" @change="onchange" title="请选择地址" />
        </van-popup>
      </li>
      <li>
        <van-cell-group style="height:52px;padding-top:5px">
          <van-field v-model="value" placeholder="详细地址：例如17号楼601等" />
        </van-cell-group>
      </li>
    </ul>
    <div style="margin-top:10px;margin-bottom:10px">
      <van-cell-group style="height:52px;padding-top:5px">
        <van-field v-model="value" placeholder="身份证号(选填)" />
      </van-cell-group>
    </div>
    <span class="text">购买跨境商品时需要姓名、身份证号用于清关，信息将被加密保存</span>
    <div class="cheak">
      <van-checkbox v-model="checked"></van-checkbox>
      <span>设为默认地址</span>
    </div>
  </div>
</template>

<script>
import address from "@/area";
export default {
  data() {
    return {
      value: "",
      areaList: address,
      show: false,
      checked: false
    };
  },
  methods: {
    black() {
      this.$router.go(-1);
    },
    changeshow() {
      this.show = true;
    },
    onchange() {}
  }
};
</script>

<style lang="less" scoped>
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 44px;
  background: #fff;
  i {
    margin-left: 10px;
    font-size: 24px;
    vertical-align: middle;
  }
  .address {
    font-size: 17px;
    color: #2e2f30;
  }
  .save {
    font-size: 15px;
    color: #797d82;
    margin-right: 15px;
  }
}
.box {
  display: flex;
  align-items: center;
  background: #fff;
  position: relative;
  padding-left: 15px;
  .i {
    position: absolute;
    left: 10px;
    top: 18px;
    z-index: 2;
  }
}
.van-cell {
  padding: 10px;
  padding-left: 15px;
}
.text {
  font-size: 11px;
  color: #bdc0c5;
  text-align: left;
  margin-top: 10px;
  padding: 0 15px;
}
.cheak {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  color: #bdc0c5;
  span {
    margin-left: 10px;
  }
}
</style>